<?php
namespace app\home\controller;
use think\Controller;
use think\Db;
use think\Loader;
use app\home\model\ArticleCate as cateModel;

class Base extends Controller
{
    public function __construct(){
		
		parent::__construct();
		cookie(['prefix' => '', 'expire' => 60*60*24]);
        $model = new cateModel();
        $cate = $model->select();
        foreach ($cate as $key=>$vo){
            $cate_arr[$key]['id'] = $vo->id;
            $cate_arr[$key]['name'] = $vo->name;
            $cate_arr[$key]['pid'] = $vo->pid;
        }
        $cates = array2tree($cate_arr,'pid');
       /// var_dump($cates);die;
        $this->assign('cates',$cates);
	}











}
